package cn.xxstudy.storage

import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView

/**
 * @author ：wuxinxi on 2020/11/7 .
 * @packages ：cn.xxstudy.storage .
 * TODO:一句话描述
 */
class GalleryActivity : AppCompatActivity() {
    private val adapter: GalleryAdapter = GalleryAdapter(arrayListOf())
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val recyclerView=RecyclerView(this)
        setContentView(recyclerView)
        recyclerView.layoutManager = GridLayoutManager(this, 2)
        recyclerView.adapter = adapter
        val intent = intent
        intent?.let {
            val list = intent.getParcelableArrayListExtra<Uri>("images")
            adapter.notify(list)
        }
    }
}